import React, {FC, useContext} from 'react';
import "./SearchDefaultLayout.less";
import JournalNewsList from "@/pages/JournalPage/JournalDetail/commons/JournalNewsList";
import HotArticles from "@/pages/HomePage/HotArticles";
import {JournalDetailContext} from "@/pages/JournalPage/JournalDetail/commons/JournalDetailContext";
import GuessLike from "@/pages/MinePage/GuessLike";
import HealthScienceAd from "@/pages/MinePage/HealthScienceAd";

interface SearchDefaultLayoutProps {
  children?: React.ReactNode;
  includeProductAds?: boolean;
  includeRecommendArticles?: boolean;
}

const SearchDefaultLayout: FC<SearchDefaultLayoutProps> = (props) => {
  const {includeProductAds = true, includeRecommendArticles = true} = props;

  return (
    <div className={"search-default-layout-container"}>
      <div className={"search-default-layout-left"}>
        {props.children}
      </div>
      {
        (includeProductAds || includeRecommendArticles) && (
          <div className={"search-default-layout-right"}>
            <div className={"search-padding-wrapping"}>
              {
                includeProductAds && (
                  <HealthScienceAd/>
                )
              }
              {
                includeProductAds && (
                  <GuessLike title={"为你推荐"}/>
                )
              }
            </div>
          </div>
        )
      }
    </div>
  );
};

export default SearchDefaultLayout;
